package com.irononetech.android.MultilevelListView;

import android.app.ExpandableListActivity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.content.Intent;
import android.content.res.Resources.NotFoundException;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.irononetech.android.Application.Application;
import com.irononetech.android.formcomponent.FormObject;
import com.irononetech.android.formcomponent.view.VehicleDetailsActivity;
import com.irononetech.android.claimsonersa.R;

public class ExpList3_Car extends ExpandableListActivity
{
	Logger LOG = LoggerFactory.getLogger(ExpList3_Car.class);

	
    static final String listdesc[][][][] = 
	{
    	{ // grey
            {  // lightgray
            	{ "Cars / Double cabs / Jeeps", "Out side parts" },
            		{ "Bonnet","" },
            		{ "Bumper","" },
            		{ "Cowl screen","" },
            		{ "Fascia rear","" },
            		{ "Shell","" },
            		{ "Pillar and hard trim","" },
            		{ "Rocker panel","" }
            	},
            	{  // darkgray
            	{ "Cars / Double cabs / Jeeps", "Doors" },
            		{ "Front right door","" },
            		{ "Front left door","" },
            		{ "Rear right door","" },
            		{ "Rear left door","" },
            		{ "Door seal","" },
            		{ "Hinge","" },
            		{ "Lock","" }
            	},
            	{  // darkgray
            		{ "Cars / Double cabs / Jeeps", "Lights" },
    		    	{ "Fog light","" },
    		    	{ "Head light","" },
    		    	{ "Interior light","" },
    		    	{ "Side lighting","" },
    		    	{ "Tail light","" },
    		    	{ "Signal light","" },
    		    	{ "Front light","" }
            	},
            	{   // darkgray
                    { "Cars / Double cabs / Jeeps", "Engine components" },
                    { "Accessory belt","" },
                    { "Dickey door","" },
                    { "Air duct","" },
                    { "Air intake housing","" },
                    { "Air intake manifold","" },
                    { "Crank case","" },
                    { "Crank pulley","" }
            	},
            	{
            		{ "Cars / Double cabs / Jeeps", "Front face panel" },
            		{ "Front buffer","" },
            		{ "Bonnet/engine hood","" },
            		{ "Front windscreen","" },
            		{ "Front single windscreen beading","" },
            		{ "L/H/S front buffer end","" },
            		{ "R/H/S front buffer end","" },
            		{ "Front grill","" },
            		{ "R/H/S head lamp","" },
            		{ "L/H/S head lamp","" },
            		{ "R/H/S head lamp frame","" },
            		{ "L/H/S head lamp frame","" },
            		{ "R/H/S front signal lamp","" },
            		{ "L/H/S front signal lamp","" },
            		{ "R/H/S front parking lamp","" },
            		{ "L/H/S front parking lamp","" },
            		{ "R/H/S front fog lamp","" },
            		{ "L/H/S front fog lamp","" },
            		{ "Front badge","" },
            		{ "Dash board","" },
            		{ "A/C blower","" },
            		{ "A/C Cooler","" },
            		{ "A/C Condenser","" },
            		{ "A/C Filter","" },
            		{ "Horn","" },
            		{ "Electric horn","" },
            		{ "Front number plate","" },
            		{ "Front number plate lamp","" },
            		{ "Trim packages","" },
            		{ "Spoilers","" },
            		{ "Crash bars","" },
            		{ "Antennas","" },
            		{ "Radiator panel","" },
            		{ "Radiator","" },
            		{ "R/H/S Front Wipers blades","" },
            		{ "L/H/S Front Wipers blades","" },
            		{ "Wiper motors","" },
            		{ "Sun Wiser","" },
            		{ "Nose cut panel","" },
            		{ "Body kits","" }
            	},
            	{
              	    { "Cars / Double cabs / Jeeps","Right side panel" },
              	    { "R/H/S fender","" },
              	    { "R/H/S Fender lights","" },
              	    { "R/H/S Fender inner","" },
              	    { "R/H/S Mudguard arch","" },
              	    { "R/H/S Fender beadings","" },
                	{ "R/H/S Fender mirrors","" },
                	{ "R/H/S Front door","" },
                	{ "R/H/S Front door glass","" },
                	{ "R/H/S Front door beadings","" }, 
                	{ "R/H/S Front winders","" }, 
                	{ "R/H/S Front door locks","" }, 
                	{ "R/H/S Front door switches","" }, 
                	{ "R/H/S Outer door handle","" },
                	{ "R/H/S Inner door handle","" }, 
                	{ "R/H/S Front door upholstery","" },
                	{ "R/H/S Front door center beadings","" },
                	{ "R/H/S Front door motors","" },
                	{ "R/H/S Rear door","" }, 
                	{ "R/H/S Rear door glass","" },
                	{ "R/H/S Rear door beadings","" }, 
                	{ "R/H/S Rear door winders","" },
                	{ "R/H/S Rear door locks","" },
                	{ "R/H/S Rear door switches","" },
                	{ "R/H/S Outer door handle","" },
                	{ "R/H/S Inner door handle","" }, 
                	{ "R/H/S Rear door upholstery","" },
                	{ "R/H/S Rear door center beadings","" },
                	{ "R/H/S Rear door motors","" },
                	{ "R/H/S Quarter panel","" }, 
                	{ "R/H/S Quarter panel lights","" },  
                	{ "R/H/S front door Hinges","" }, 
                	{ "R/H/S rear door Hinges","" }, 
                	{ "Tie rod","" },
                	{ "Rack end","" },
                	{ "Lower arm","" },
                	{ "Upper arm","" },
                	{ "Drag link","" },
                	{ "Ball joint","" },
                	{ "Sun Wiser","" },
                	{ "Body kits","" }, 
                	{ "Front Shock absorbers","" }, 
                	{ "Rear shock absorbers","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Left side panel" },
              	  { "L/H/S fender","" },
              	  { "L/H/S Fender lights","" },
              	  { "L/H/S Fender inner","" },
              	  { "L/H/S Mudguard arch","" },
              	  { "L/H/S Fender beadings","" },
              	  { "L/H/S Fender mirrors","" },
              	  { "L/H/S Front door","" },
              	  { "L/H/S Front door glass","" }, 
              	  { "L/H/S Front door beadings","" }, 
              	  { "L/H/S Front winders","" },
              	  { "L/H/S Front door locks","" }, 
              	  { "L/H/S Outer door handle","" },
              	  { "L/H/S Inner door handle","" }, 
              	  { "L/H/S Front door switches","" }, 
              	  { "L/H/S Front door upholstery","" },
              	  { "L/H/S Front door center beadings","" },
              	  { "L/H/S Front door motors","" },
              	  { "L/H/S Rear door","" }, 
              	  { "L/H/S Rear door glass","" },
              	  { "L/H/S Rear door beadings","" }, 
              	  { "L/H/S Rear door winders","" },
              	  { "L/H/S Rear door locks","" },
              	  { "L/H/S Rear door switches","" },
              	  { "L/H/S Outer door handle","" },
              	  { "L/H/S Inner door handle","" },
              	  { "L/H/S Rear door upholstery","" },
              	  { "L/H/S Rear door center beadings","" },
              	  { "L/H/S Rear door motors","" },
              	  { "L/H/S Quarter panel","" }, 
              	  { "L/H/S Quarter panel lights","" },  
              	  { "L/H/S front door Hinges","" }, 
              	  { "L/H/S rear door Hinges","" }, 
              	  { "Tie rod","" },
              	  { "Rack end","" },
              	  { "Lower arm","" },
              	  { "Upper arm","" },
              	  { "Drag link","" },
              	  { "Ball joint","" },
              	  { "Sun Wiser","" },
              	  { "Body kits","" },
              	  { "Front Shock absorbers","" }, 
              	  { "Rear shock absorbers","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Rear side" },
              	  { "Rear buffer","" }, 
              	  { "Rear Buffer lights","" }, 
              	  { "Rear Buffer sensors","" }, 
              	  { "Rear Buffer cameras","" }, 
              	  { "R/H/S tail lights","" }, 
              	  { "L/H/S tail lights","" }, 
              	  { "Rear dickey lid","" }, 
              	  { "Rear dickey lid lights","" }, 
              	  { "Rear dickey locks","" },  
              	  { "Rear dickey spoilers","" },  
              	  { "R/H/S signal lights","" }, 
              	  { "L/H/S signal lights","" }, 
              	  { "Rear Badges","" },  
              	  { "Rear Garnishes","" },  
              	  { "Hood spoilers","" },  
              	  { "Hood racks","" },  
              	  { "Rear spare wheel","" },  
              	  { "Rear spare wheel holders","" }, 
              	  { "Rear glass","" }, 
              	  { "Rear glass beadings","" }, 
              	  { "Rear decks","" }, 
              	  { "Rear deck doors","" }, 
              	  { "Rear rolling over bars","" }, 
              	  { "Rear Canopy Rexene","" }, 
              	  { "Rear Trim packages","" }, 
              	  { "Rear door beadings","" }, 
              	  { "Rear flash lights","" },  
              	  { "Carry boy assembly","" }, 
              	  { "Inner panel assembly","" },  
              	  { "Battery (hybrid)","" }, 
              	  { "Outer door handle","" }, 
              	  { "Inner door handle","" },  
              	  { "Wipers","" },
              	  { "Wiper motors","" },  
              	  { "Sun Wiser","" },
              	  { "Rolling over bars","" },  
              	  { "Body kits","" },
              	  { "Carry boy panel","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Engine compartment and components" },
              	  { "Diesel, petrol engine (gasoline engine)","" }, 
              	  { "Accessory belt","" },  
              	  { "Air duct","" },  
              	  { "Air intake housing","" },  
              	  { "Air intake manifold","" },  
              	  { "Camshaft","" },  
              	  { "Camshaft bearing","" },  
              	  { "Camshaft fastener","" },  
              	  { "Camshaft follower","" },  
              	  { "Camshaft locking plate","" },  
              	  { "Camshaft pushrod","" },  
              	  { "Camshaft spacer ring","" },  
              	  { "Connecting rod","" },  
              	  { "Connecting rod bearing","" },  
              	  { "Connecting rod bolt","" },  
              	  { "Connecting rod washer","" },  
              	  { "Crank case","" },  
              	  { "Crank pulley","" },  
              	  { "Crankshaft","" },  
              	  { "Crankshaft oil seal","" },  
              	  { "Cylinder head","" },  
              	  { "Cylinder head cover","" },  
              	  { "Other cylinder head cover parts","" },  
              	  { "Cylinder head gasket","" },  
              	  { "Distributor","" },  
              	  { "Distributor cap","" },  
              	  { "Drive belt","" },  
              	  { "Engine block","" },  
              	  { "Engine block parts","" },  
              	  { "Engine cradle","" },  
              	  { "Engine shake damper and vibration absorber","" },  
              	  { "Engine valve","" },  
              	  { "Fan belt","" },  
              	  { "Gudgeon pin (wrist pin)","" },  
              	  { "Harmonic balancer","" },  
              	  { "Heater","" },  
              	  { "Mounting bolt","" },  
              	  { "Piston pin and crank pin","" },  
              	  { "Piston pin bush","" },  
              	  { "Piston ring and circlip","" },  
              	  { "Piston valve","" },  
              	  { "Poppet valve","" },  
              	  { "PCV valve (positive crankcase ventilation valve)","" },  
              	  { "Pulley part","" },  
              	  { "Rocker arm","" }, 
              	  { "Rocker cover Starter motor","" },  
              	  { "Rocker cover Starter pinion","" },  
              	  { "Rocker cover Starter ring","" },  
              	  { "Turbocharger and supercharger","" },  
              	  { "Tappet","" }, 
              	  { "Timing tape","" },  
              	  { "Valve cover","" }, 
              	  { "Valve housing","" },  
              	  { "Valve spring","" }, 
              	  { "Valve stem seal","" }, 
              	  { "Water pump pulley","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps", "Engine cooling system" },
              	  { "Air blower","" },
              	  { "Coolant hose cooling fan","" }, 
              	  { "Fan blade","" },
              	  { "Fan clutch","" },
              	  { "Radiator bolt","" },
              	  { "Radiator shroud","" },
              	  { "Radiator gasket","" },
              	  { "Radiator pressure cap","" }, 
              	  { "Water neck","" },
              	  { "Water neck o-ring","" }, 
              	  { "Water pipe","" },
              	  { "Water pump","" },
              	  { "Water pump gasket","" }, 
              	  { "Water tank","" },
              	  { "Thermostat","" }
                },
                {          
              	  { "Cars / Double cabs / Jeeps", "Engine oil system" },
              	  { "Oil filter","" }, 
              	  { "Oil gasket","" }, 
              	  { "Oil pan","" },
              	  { "Oil pipe","" }, 
              	  { "Oil pump","" }, 
              	  { "Oil strainer","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Exhaust system",},
              	  { "Catalytic converter","" },
              	  { "Exhaust clamp and bracket","" }, 
              	  { "Exhaust flange gasket","" },
              	  { "Exhaust gasket","" }, 
              	  { "Exhaust manifold","" }, 
              	  { "Exhaust manifold gasket","" }, 
              	  { "Exhaust pipe","" }, 
              	  { "Heat shield","" }, 
              	  { "Heat sleeving and tape","" }, 
              	  { "Muffler (silencer)","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps", "Fuel supply system" },
              	  { "Air filter","" },
              	  { "Carburetor","" },
              	  { "Carburetor parts","" },
              	  { "Choke cable","" },
              	  { "EGR valve","" },
              	  { "Fuel cap","" },
              	  { "Fuel cell","" },
              	  { "Fuel cell component","" },
              	  { "Fuel cooler","" },
              	  { "Fuel distributor","" },
              	  { "Fuel filter","" },
              	  { "Fuel filter seal","" },
              	  { "Fuel injector","" },
              	  { "Fuel injector nozzle","" },
              	  { "Fuel pump","" },
              	  { "Fuel pump gasket","" },
              	  { "Fuel pressure regulator","" },
              	  { "Fuel rail","" },
              	  { "Fuel tank","" },
              	  { "Fuel tank cover","" },
              	  { "Fuel water separator","" },
              	  { "Intake manifold","" },
              	  { "Intake manifold gasket","" },
              	  { "LPG (Liquefied petroleum gas) system assembly","" }, 
              	  { "Throttle body","" },
              	  { "Universal joint","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Suspension and steering systems" },
              	  { "Beam axle","" }, 
              	  { "Control arm","" },
              	  { "Constant-velocity axle","" }, 
              	  { "Constant-velocity joint","" }, 
              	  { "Idler arm","" }, 
              	  { "Kingpin","" }, 
              	  { "Pan hard rod","" }, 
              	  { "Pitman arm","" }, 
              	  { "Power steering assembly and component","" }, 
              	  { "Rack end","" }, 
              	  { "Shock absorber","" }, 
              	  { "Spindle","" }, 
              	  { "Spring - Air spring","" }, 
              	  { "Spring - Coil spring","" }, 
              	  { "Spring - Leaf and parabolic leaf spring","" }, 
              	  { "Spring - Rubber spring","" }, 
              	  { "Spring - Spiral spring","" }, 
              	  { "Stabilizer bars and link","" }, 
              	  { "Steering arm","" }, 
              	  { "Steering box","" }, 
              	  { "Steering column assembly","" }, 
              	  { "Steering rack (A form of steering gear)","" }, 
              	  { "Steering shaft","" }, 
              	  { "Steering wheel (driving wheel)","" }, 
              	  { "Strut","" }, 
              	  { "Stub axle","" }, 
              	  { "Suspension link and bolt","" }, 
              	  { "Tie bar","" }, 
              	  { "Tie rod","" }, 
              	  { "Tie rod end","" }, 
              	  { "Trailing arm","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Transmission system" },
              	  { "Adjustable pedal","" },
              	  { "Axle shaft","" }, 
              	  { "Bell housing","" }, 
              	  { "Timing belt","" }, 
              	  { "Cam belt","" }, 
              	  { "Other belts","" }, 
              	  { "Carrier assembly","" }, 
              	  { "Chain wheel and sprocket","" }, 
              	  { "Clutch assembly - Clutch cable","" }, 
              	  { "Clutch assembly - Clutch disk","" }, 
              	  { "Clutch assembly - Clutch fan","" }, 
              	  { "Clutch assembly - Clutch fork","" }, 
              	  { "Clutch assembly - Clutch hose","" }, 
              	  { "Clutch assembly - Clutch lever","" }, 
              	  { "Clutch assembly - Clutch lining","" }, 
              	  { "Clutch assembly - Clutch pedal","" }, 
              	  { "Clutch assembly - Clutch pressure plate","" }, 
              	  { "Clutch assembly - Clutch shoe","" }, 
              	  { "Clutch assembly - Clutch spring","" }, 
              	  { "Differential case - Pinion bearing","" }, 
              	  { "Differential case - Differential clutch","" }, 
              	  { "Differential case - Spider gears","" }, 
              	  { "Differential case - Differential casing","" }, 
              	  { "Differential flange","" }, 
              	  { "Differential gear","" }, 
              	  { "Differential seal","" }, 
              	  { "Flywheel - Flywheel ring gear","" }, 
              	  { "Gear coupling","" }, 
              	  { "Gear pump","" }, 
              	  { "Gear ring","" }, 
              	  { "Gear stick (gear stick, gear lever, selection lever, shift stick, gear shifter)","" }, 
              	  { "Gearbox","" }, 
              	  { "Idler gear","" }, 
              	  { "Knuckle","" }, 
              	  { "Master cylinder","" }, 
              	  { "Output shaft","" }, 
              	  { "Pinion","" }, 
              	  { "Planetary gear set","" }, 
              	  { "Prop shaft (drive shaft, propeller shaft)","" }, 
              	  { "Shift cable","" }, 
              	  { "Shift fork","" }, 
              	  { "Shift knob","" }, 
              	  { "Shift lever","" }, 
              	  { "Slave cylinder","" }, 
              	  { "Speed reducer","" }, 
              	  { "Speedometer gear","" }, 
              	  { "Steering gear","" }, 
              	  { "Torque converter","" }, 
              	  { "Transaxle housing","" }, 
              	  { "Transfer case","" }, 
              	  { "Transmission gear","" }, 
              	  { "Transmission pan","" }, 
              	  { "Transmission seal and bonded piston","" }, 
              	  { "Transmission spring","" }, 
              	  { "Transmission yolk","" }
                },
                {
              	  { "Cars / Double cabs / Jeeps","Other miscellaneous parts" },
              	  { "Adhesive tape and foil","" },  
              	  { "Bolt cap","" },
              	  { "License plate bracket","" }, 
              	  { "Speedometer cable","" },
              	  { "Cotter pin","" }, 
              	  { "Decal","" }, 
              	  { "Dashboard","" }, 
              	  { "Center console","" }, 
              	  { "Glove compartment","" }, 
              	  { "Drag link","" }, 
              	  { "Dynamic seal","" }, 
              	  { "Fastener","" }, 
              	  { "Gasket: Flat, molded, profiled","" }, 
              	  { "Hood and trunk release cable","" }, 
              	  { "Horn and trumpet horn","" }, 
              	  { "Injection-molded parts","" }, 
              	  { "Instrument cluster","" }, 
              	  { "Label","" }, 
              	  { "Mirror","" }, 
              	  { "Mount and mounting","" }, 
              	  { "Name plate","" }, 
              	  { "Flange nut","" }, 
              	  { "Hex nut","" }, 
              	  { "O-ring","" }, 
              	  { "Paint","" },
              	  { "Rivet","" },
              	  { "Rubber (extruded and molded)","" }, 
              	  { "Screw","" }, 
              	  { "Shim","" },
              	  { "Sun visor","" }
                },
          }
  	};

  FormObject fo;  
  static boolean booleanlistCar[][][][];
  static boolean booleanprelistCar[][][][];
  Button back;
  EditText otherfield;
  
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle){
        try {
			super.onCreate(icicle);
			LOG.debug("ENTRY onCreate");
			setContentView(R.layout.multilevel_expandable_list_main);
			fo=com.irononetech.android.Application.Application.getFormObjectInstance();
			back = (Button)findViewById(R.id.button2);
			otherfield = (EditText)findViewById(R.id.damagedItemsOtherField);
			
			if(fo.getisPreSelected())  //PRE
			{
				otherfield.setText(fo.getpredamagedItemsOtherField());
				booleanprelistCar = fo.getBooleanprelistCar();
			    colorExpListAdapter=
					new ColorExpListAdapterCar(
						this,
			            getExpandableListView(),
			            listdesc
					);
				setListAdapter( colorExpListAdapter );
				
				back.setBackgroundDrawable(getResources()
						.getDrawable(R.drawable.back_button_xml));
			}
			else {
			otherfield.setText(fo.getdamagedItemsOtherField());
			booleanlistCar = fo.getBooleanlistCar();
			colorExpListAdapter=
				new ColorExpListAdapterCar(
					this,
			        getExpandableListView(),
			        listdesc
				);
			setListAdapter( colorExpListAdapter );
			
			back.setBackgroundDrawable(getResources()
					.getDrawable(R.drawable.cancel_button_xml));
			}
			if(!fo.isEditable()){
				editDisable();
			}
			LOG.debug("SUCCESS onCreate");
		} catch (NotFoundException e) {
			LOG.error("onCreate:10303");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		} catch (Exception e) {
			LOG.error("onCreate:10304");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		}
    }

    public void editDisable() {
    	try {
			otherfield.setFocusable(false);
			
			if(fo.getisPreSelected())  //PRE
			{
				back.setBackgroundDrawable(getResources()
						.getDrawable(R.drawable.back_button_xml));
			} else{
				back.setBackgroundDrawable(getResources()
						.getDrawable(R.drawable.back_button_xml));
			}
		} catch (NotFoundException e) {
			LOG.error("editDisable:10305");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		} catch (Exception e) {
			LOG.error("editDisable:10306");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		}
    }
    
    public void editEnable() {
    	try {
			otherfield.setFocusable(true);
			
			if(fo.getisPreSelected())  //PRE
			{
				back.setBackgroundDrawable(getResources()
						.getDrawable(R.drawable.back_button_xml));
			} else{
				back.setBackgroundDrawable(getResources()
						.getDrawable(R.drawable.cancel_button_xml));
			}
		} catch (NotFoundException e) {
			LOG.error("editEnable:10307");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		} catch (Exception e) {
			LOG.error("editEnable:10308");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		}
    }
    
    public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			return false;
		}
		return super.onKeyDown(keyCode, event);
	}
    
    
    public void multilevel_ok_click(View v){
    	try {
			if(fo.getisPreSelected())  //PRE
			{
			  fo.setBooleanprelistCar(booleanprelistCar);
			  fo.setpredamagedItemsOtherField(otherfield.getText().toString().trim());
			}
			else{
				fo.setBooleanlistCar(booleanlistCar);
				fo.setdamagedItemsOtherField(otherfield.getText().toString().trim());
			}
			  
			  Intent mIntent = new Intent(ExpList3_Car.this,
						VehicleDetailsActivity.class);
				mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
				startActivity(mIntent);
				finish();
		} catch (Exception e) {
			LOG.error("multilevel_ok_click:10309");
			   if(e != null){
				LOG.error("Message: " + e.getMessage());
				LOG.error("StackTrace: " + e.getStackTrace());
			  }
		}
    }
    
public void multilevel_back_button(View v){
	try {
		if (fo.isEditable()) {
			int p1 = Application.get4DArrSizeSec1();
			int p2 = Application.get4DArrSizeSec2();
			int p3 = Application.get4DArrSizeSec3();
			int p4 = Application.get4DArrSizeSec4();
			boolean[][][][] a = new boolean[p1][p2][p3][p4];
			if(!fo.getisPreSelected()) {
				  //Damaged Items
				  fo.setisVehicleShow(true);
				  fo.setdamagedItemsOtherField("");
				  fo.setpredamagedItemsOtherField("");
				  fo.setBooleanlistCar(a);
				  fo.setBooleanprelistCar(a);
				}
			else{
				//Pre Damaged Items
				fo.setBooleanprelistCar(a);
				fo.setpredamagedItemsOtherField(otherfield.getText().toString().trim());
			}
		}
		finish();
	} catch (Exception e) {
		LOG.error("multilevel_back_button:10310");
		   if(e != null){
			LOG.error("Message: " + e.getMessage());
			LOG.error("StackTrace: " + e.getStackTrace());
		  }
	}
    }

    private ColorExpListAdapterCar colorExpListAdapter;
}